import Request from "../utils/Request";

//登陆接口
export const login = (data) =>
  Request({
    url: `/api/user/login.do?username=${data.username}&password=${data.password}`,
    method: "post",
  });
// 获取用户列表
export const userList = (url) =>
  Request({
    url,
    method: "post",
    params: url
  });

// 商品详情
export const listContainerRight = (data) => Request({
  url: `/api/product/list.do?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
  method: "post",
  params: data
})

// 查看详情
export const deatil=(data)=>Request({
  url:`/api/product/detail.do?productId=${data}`,
  method:"GET"
})

//品类管理
// export const category1 = (data) => Request({
//   url: `/api/category/get_category.do`,
//   method: "get",
//   params: data
// })
//品类管理
export const Category1 = (data) => Request({
  url: "/api/category/get_category.do",
  method: "get",
  params: data
})

//添加商品
export const add = (form)=>Request({
  url:`/api/product/save.do`,
  method:"POST",
  params:form
})

//添加图片
export const addimg = (data) => Request({
  url: "/api/product/upload.do",
  method: "post",
  params: data
})

//搜索
export const Search = (data) => Request({
  url: `/api/product/search.do`,
  method: "get",
  params: data
})

//编辑
export const edit = (form) => Request({
  url: "/api/product/save.do",
  method: "post",
  params: form
})

//创建新的品类管理
export const category = (form) => Request({
  url: "/api/category/add_category.do",
  method: "post",
  params: form
})

//查看子品类
export const category2 = (data) => Request({
  url: `/api/category/get_category.do?categoryId=${data}`,
  method: "get"
})

//修改品类名
export const gai = (data) => Request({
  url: `/api/category/set_category_name.do`,
  method: "get",
  params: data
})

//订单商品

export const shanglist = (data) => Request({
  url: `/api/order/list.do`,
  method: "get",
  params: data
})

//订单查看
export const shanglist1 = (data) => Request({
  url: `/api/order/detail.do?orderNo=${data}`,
  method: "get",
})

//订单搜索
export const shanglist2 = (data) => Request({
  url: `/api/order/search.do?`,
  method: "get",
  params:data
})